/*
 * @Author: zhouwei wei.zhou@flip.fun
 * @Date: 2024-04-09 23:34:41
 * @LastEditors: zhouwei wei.zhou@flip.fun
 * @LastEditTime: 2024-04-17 19:34:58
 * @FilePath: /50/手撕系列/tree.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const source = [
	{
		id: 1,
		pid: 0,
		name: 'body',
	},
	{
		id: 2,
		pid: 1,
		name: 'title',
	},
	{
		id: 3,
		pid: 2,
		name: 'div',
	},
	{
		id: 99,
		pid: 12,
		name: 'script',
	},
]
/**4.4
 *
 * @param {{pid:number,id:number,name:string}[]} arr
 */
function tree(arr) {
	const result = []
    const childrenMap = {
        
    }
	arr.forEach(item => {
        
    })
}
